import { createComponent } from '@mpxjs/core'

interface CustomTabBarComponentVo {
  data: {

  }
}

createComponent({
  data: {
    selected: 0,
    color: "#7A7E83",
    selectedColor: "#3cc51f",
    "list": [
      {
        "text": "推荐",
        "pagePath": "/pages/recommend/index",
        "iconPath": "/assets/images/icon_component.png",
        "selectedIconPath": "/assets/images/icon_component_HL.png"
      },
      {
        "text": "排行",
        "pagePath": "/pages/rank/index",
        "iconPath": "/assets/images/icon_API.png",
        "selectedIconPath": "/assets/images/icon_API_HL.png"
      }
    ]
  },
  methods: {
    switchTab(e: any) {
      console.log('any e', e);
      const data = e.currentTarget.dataset
      const url = data.path
      console.log('url', url);
      wx.switchTab({ url })
      this.selected = data.index;
    }
  }
})
